package com.sanji.sjmallmodule.order;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.sanji.sjmallapp.R;
import com.sanji.sjmallmodule.phoneshell.PhoneShellActivity;
import com.sanji.sjmallmodule.phoneshell.ShellShopCarActivity;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by Administrator on 2017/9/10.
 */

public class ShopcarNewFragment extends Fragment implements View.OnClickListener{

    @BindView(R.id.common_title_tv)
    TextView titleTv;
    @BindView(R.id.common_back_img)
    ImageView mCommonBackImg;
    @BindView(R.id.shop_phone_tv)
    TextView mShopPhoneTv;
    @BindView(R.id.shop_phone_shell_tv)
    TextView mShopPhoneShellTv;
    private View rootView;
    Intent intent;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        if (rootView == null) {
            rootView = inflater.inflate(R.layout.activity_phone_shell, null);
            ButterKnife.bind(this, rootView);
            initView();
        }
        return rootView;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
    }

    private void initView() {
        titleTv.setText("购物车");
        mCommonBackImg.setVisibility(View.GONE);
        mShopPhoneTv.setOnClickListener(this);
        mShopPhoneShellTv.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.shop_phone_shell_tv:
                intent = new Intent(getActivity(), ShellShopCarActivity.class);
                startActivity(intent);
                break;
            case R.id.shop_phone_tv:
                intent = new Intent(getActivity(), ShopcarCommonActivity.class);
                startActivity(intent);
                break;

        }
    }
}
